package com.example.localareanetworkchat.fragment.entity

import com.example.localareanetworkchat.persistence.entity.ChatGroup
import com.example.localareanetworkchat.persistence.entity.ChatGroupUser
import com.example.localareanetworkchat.persistence.entity.ChatMessage
import com.fasterxml.jackson.annotation.JsonProperty

class ChatData

data class ChatRequestData(
    @JsonProperty("type")
    val type: String,
    @JsonProperty("data")
    val data: String
)
data class ChatResponseData(
    @JsonProperty("status")
    val status: String,
    @JsonProperty("message")
    val message: String,
    @JsonProperty("data")
    var data: String
)

class ChatRequestDataType {
    companion object {
        const val JOIN_GROUP = "JOIN_GROUP"
        const val JOIN_GROUP_FROM_OTHER_USER = "JOIN_GROUP_FROM_OTHER_USER"
        const val CHAT_GROUP_MESSAGE = "CHAT_GROUP_MESSAGE"
    }
}
class ChatResponseDataType {
    companion object {
        const val JOIN_GROUP_INVITATION_CODE_ERROR = "JOIN_GROUP_INVITATION_CODE_ERROR"
        const val JOIN_GROUP_OK = "JOIN_GROUP_OK"
        const val JOIN_GROUP_ALREADY_IN = "JOIN_GROUP_ALREADY_IN"
        const val JOIN_GROUP_ID_ERROR = "JOIN_GROUP_ID_ERROR"
        const val CHAT_GROUP_MESSAGE_RECEIVED_OK = "CHAT_GROUP_MESSAGE_RECEIVED_OK"

    }
}

data class JoinGroupRequestData(
    @JsonProperty("invitationCode")
    val invitationCode: String,
    @JsonProperty("chatGroupId")
    val chatGroupId: String,
    @JsonProperty("joinAddress")
    val joinAddress: String,
    @JsonProperty("userName")
    val userName: String,
    @JsonProperty("uid")
    val uid: String
)
data class JoinGroupResponseData(
    @JsonProperty("type")
    val type: String,
    @JsonProperty("chatGroupUserList")
    val chatGroupUserList: ArrayList<ChatGroupUser>?,// 端点已知的group user
    @JsonProperty("chatGroup")
    val chatGroup: ChatGroup?,
    @JsonProperty("groupPairUid")
    val groupPairUid: ArrayList<String>? // 两端用户的uid
)

data class ChatMessageRequestData(
    @JsonProperty("chatMessage")
    val chatMessage: ChatMessage
)
data class ChatMessageResponseData(
    @JsonProperty("type")
    val type: String
)